home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / exec / initsemaphore.c < prev    next >
C/C++ Source or Header  |  1996-10-24  |  2KB  |  77 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: initsemaphore.c,v 1.5 1996/10/24 15:50:51 aros Exp $
  4.     $Log: initsemaphore.c,v $
  5.     Revision 1.5  1996/10/24 15:50:51  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/08/13 13:56:03  digulla
  9.     Replaced AROS_LA by AROS_LHA
  10.     Replaced some AROS_LH*I by AROS_LH*
  11.     Sorted and added includes
  12.  
  13.     Revision 1.3  1996/08/01 17:41:12  digulla
  14.     Added standard header for all files
  15.  
  16.     Desc:
  17.     Lang: english
  18. */
  19. #include "exec_intern.h"
  20.  
  21. /*****************************************************************************
  22.  
  23.     NAME */
  24.     #include <exec/semaphores.h>
  25.     #include <clib/exec_protos.h>
  26.  
  27.     AROS_LH1I(void, InitSemaphore,
  28.  
  29. /*  SYNOPSIS */
  30.     AROS_LHA(struct SignalSemaphore *, sigSem, A0),
  31.  
  32. /*  LOCATION */
  33.     struct ExecBase *, SysBase, 93, Exec)
  34.  
  35. /*  FUNCTION
  36.     Prepares a semaphore structure for use by the exec semaphore system,
  37.     i.e. this function must be called after allocating the semaphore and
  38.     before using it or the semaphore functions will fail.
  39.  
  40.     INPUTS
  41.     sigSem - Pointer to semaphore structure
  42.  
  43.     RESULT
  44.  
  45.     NOTES
  46.     Semaphores are shared between the tasks that use them and must
  47.     therefore lie in public (or at least shared) memory.
  48.  
  49.     EXAMPLE
  50.  
  51.     BUGS
  52.  
  53.     SEE ALSO
  54.  
  55.     INTERNALS
  56.  
  57.     HISTORY
  58.     29-10-95    digulla automatically created from
  59.                 exec_lib.fd and clib/exec_protos.h
  60.     21-01-96    fleischer implementation
  61.  
  62. *****************************************************************************/
  63. {
  64.     AROS_LIBFUNC_INIT
  65.  
  66.     /* Clear list of wait messages */
  67.     sigSem->ss_WaitQueue.mlh_Head    =(struct MinNode *)&sigSem->ss_WaitQueue.mlh_Tail;
  68.     sigSem->ss_WaitQueue.mlh_Tail    =NULL;
  69.     sigSem->ss_WaitQueue.mlh_TailPred=(struct MinNode *)&sigSem->ss_WaitQueue.mlh_Head;
  70.  
  71.     /* Semaphore is currently unused */
  72.     sigSem->ss_NestCount=0;
  73.  
  74.     AROS_LIBFUNC_EXIT
  75. } /* InitSemaphore */
  76.  
  77.